<?php
    $load = Addresing::get('load');
    
    if($load == "new_is") {
	$page = "index.php?tab=changes&load=new_is";
	include "CHANGES_IN_DB/insertNewIS.php";
    } elseif($load == "new_measure") {
	$page = "index.php?tab=changes&load=new_measure";
	include "CHANGES_IN_DB/insertNewMeasure.php";
    }elseif($load == "new_subdivision") {
	$page = "index.php?tab=changes&load=new_subdivision";
	include "CHANGES_IN_DB/insertNewSubdivision.php";
    } elseif($load == "to_subdivision") {
	$page = "index.php?tab=changes&load=to_subdivision";
	include "CHANGES_IN_DB/addIsToSubdivision.php";
    } elseif($load == "to_measure") {
	$page = "index.php?tab=changes&load=to_measure";
	include "CHANGES_IN_DB/addSubdivisionsToMeasure.php";
    } else {
	$by = Addresing::get('by');
	if(empty($by)) {
	    $by = 'time';
	}
	$for = Addresing::get('for');
	if(empty($for)) {
	    $for = 'subdivision';
	}
	$from = "2011-10-01";
	$to = "2011-10-25";
?>
	<table border="1">
	    <tr><th align="left">Pakeitimai&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th><th align="left">Įtaka</th></tr>
	    <tr VALIGN=TOP><td><a href="index.php?tab=changes&load=new_is">Sukurti naują IS</a></td><td ROWSPAN="13"><?php include "CHANGES_IN_DB/changesTable.php";?></td></tr>
	    <tr><td><a href="index.php?tab=changes&load=new_subdivision">Sukurti naują padalinį</a></td></tr>
	    <tr><td><a href="index.php?tab=changes&load=new_measure">Sukurti naują paramos priemonę</a></td></tr>
	    <tr><td>----------------------</td></tr>
	    <tr><td><a href="index.php?tab=changes&load=to_subdivision">Prijungti padaliniui Informacines sistemas</a></td></tr>
	    <tr><td><a href="index.php?tab=changes&load=to_measure">Prijungti paramai padalinius</a></td></tr>
	    <tr><td>----------------------</td></tr>
	    <tr><td>Prašom importuoti duomenis apie prognozuojamus kiekius(<a href="index.php?input">Čia</a>)</td></tr>
	    <tr><td><a href="index.php?tab=changes&<?php print "by=time&for=".$for;?>">Pagal laiką</a> | <a href="index.php?tab=changes&<?php print "by=count&for=".$for;?>">Pagal skaičių</a></td></tr>
	    <tr><td><a href="index.php?tab=changes&<?php print "by=".$by."&for=subdivision";?>">Padaliniai</a> | <a href="index.php?tab=changes&<?php print "by=".$by."&for=is";?>">IS</a></td></tr>
	    <tr><td>Nuo <?php print date('Y-m-d', $from);?></td></tr>
	    <tr><td>Iki <?php print date('Y-m-d', $to);?></td></tr>
	    <tr></tr>
	</table>
<?php	   }?>